
<div class="eject_con group_apply">
    <div id="apply_warning"></div>
    <form id="apply_form" action="{:url('circle/group/manage_apply',array('c_id'=>$c_id))}?t=1" method="post">
        <input type="hidden" name="form_submit" value="ok" />
        <dl>
            <dt>申请成为“<?php echo $circle_info['circle_name'];?>”管理员的原因</dt>
            <dd>
                <h4><i class="a"></i>希望您能告诉我们是什么原因使您希望成为本圈管理？</h4>
                <h5>例如：本人在线时间长，有充裕的时间管理本圈。;</h5>
                <textarea name="apply_reason" class="textarea"></textarea>
            </dd>
        </dl>
        <div class="bottom"> <a class="submit-btn" nctype="apply_submit" href="Javascript: void(0)">提交申请</a><a class="cancel-btn" nctype="apply_cancel" href="Javascript: void(0)">取消</a>
        </div>
    </form>
</div>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.validation.min.js"></script>
<script type="text/javascript">
    $(function(){
        $('a[nctype="apply_submit"]').click(function(){
            if($("#apply_form").valid()){
                $("#apply_form").submit();
            }
        });
        $('a[nctype="apply_cancel"]').click(function(){
            DialogManager.close('manage_apply');
        });
        $('#apply_form').validate({
            errorLabelContainer: $('#apply_warning'),
            invalidHandler: function(form, validator) {
                $('#apply_warning').show();
            },
            submitHandler:function(form){
                ajaxpost('apply_form', "{:get_root_url()}/circle/group/manage_apply?c_id={$c_id}", '', 'onerror');
            },
            rules : {
                apply_reason : {
                    required : true,
                    maxlength : 140
                }
            },
            messages : {
                apply_reason : {
                    required : '请填写申请原因',
                    maxlength : '申请原因不能超过140个字符'
                }
            }
        });
    });
</script>